home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / nocursor.aqm / nocursor.asm
Encoding:
Assembly Source File  |  1985-11-22  |  2.9 KB  |  72 lines

  1.         TITLE   NOCURSOR -- Making the Cursor Disappear.
  2.  
  3. TRUE            EQU     01H            ; boolean true
  4. FALSE           EQU     00H            ; boolean false
  5. VIDEO_IO        EQU     10H            ; BIOS video I/O routine
  6. SET_CURSOR_TYPE EQU     01H            ;  cursor type option
  7. SET_CURSOR_POS  EQU     02H            ;  cursor positon opt
  8.  
  9. NOCURSOR SEGMENT PUBLIC 'CODE'
  10.         ASSUME CS:NOCURSOR
  11.         ASSUME DS:NOTHING
  12.  
  13. COLOR_ADAPTER   DB      TRUE           ; change if you have mono
  14.  
  15. ; CURSOR_HIDE hides the cursor by telling the BIOS to
  16. ; position it one line below the bottom of the display.
  17.  
  18.         PUBLIC  CURSOR_HIDE
  19. CURSOR_HIDE     PROC FAR
  20.         PUSH    AX                     ; save registers
  21.         PUSH    DX
  22.         PUSH    BX
  23.         MOV     DH,25                  ; set row for cursor
  24.         MOV     DL,0                   ; set column for cursor
  25.         MOV     BH,0                   ; set video page
  26.         MOV     AH,SET_CURSOR_POS      ; cursor position option
  27.         INT     VIDEO_IO               ; call BIOS video I/O
  28.         POP     BX                     ; restore registers
  29.         POP     DX
  30.         POP     AX
  31.         RET
  32. CURSOR_HIDE     ENDP
  33.  
  34. ; CURSOR_SHRINK shrinks the cursor down to nothing by telling
  35. ; BIOS that the cursor starts and stops on scan line 14 for the
  36. ; monochrome adapter and scan line 8 for the color adapter.
  37.  
  38.         PUBLIC  CURSOR_SHRINK
  39. CURSOR_SHRINK   PROC FAR
  40.         PUSH    AX                     ; save registers
  41.         PUSH    CX
  42.         MOV     CH,0EH                 ; cursor start reg: mono
  43.         MOV     CL,0EH                 ; cursor end reg : mono
  44.         CMP     COLOR_ADAPTER,TRUE     ; color adapter active?
  45.         JNE     C1                     ; no, mono start & end
  46.         MOV     CH,08H                 ; cursor start reg: color
  47.         MOV     CL,08H                 ; cursor end reg: color
  48. C1:     MOV     AH,SET_CURSOR_TYPE     ; set cursor type option
  49.         INT     VIDEO_IO               ; call BIOS video I/O
  50.         POP     CX                     ; restore registers
  51.         POP     AX
  52.         RET
  53. CURSOR_SHRINK   ENDP
  54.  
  55. ; CURSOR_DISAPPEAR reliably makes the cursor disappear by using
  56. ; an undocumented feature of the BIOS video routine.
  57.  
  58.         PUBLIC  CURSOR_DISAPPEAR
  59. CURSOR_DISAPPEAR PROC FAR
  60.         PUSH    AX                     ; save registers
  61.         PUSH    CX
  62.         MOV     CH,00100000B           ; bit 5 on, bit 6 off
  63.         MOV     AH,SET_CURSOR_TYPE     ; set cursor type option
  64.         INT     VIDEO_IO               ; call BIOS video I/O
  65.         POP     CX                     ; restore registers
  66.         POP     AX
  67.         RET
  68. CURSOR_DISAPPEAR ENDP
  69.  
  70. NOCURSOR ENDS
  71.         END
  72.